<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../vue.js"> </script>
    <style>
        div {
            float: left;
        }

        .public {
            width: 200px;
            height: 200px;
            border: 1px solid #000
        }

        .active {
            background: pink;
        }

        .noActive {
            background-color: yellowgreen;
        }

        .aqua {
            color: aqua;
        }

        .bold {
            font-weight: bold;
            /* 加粗 */
        }

        .italic {
            font-style: italic;
            /* 斜体 */
        }
    </style>
</head>

<body>
    <div id="app">
        <!-- 1.字符串 -->
        <div class="public" :class="isActive?'active':'noActive'">one</div>
        <div class="public" :class="fontColorClass">two</div>
        <!-- 对象 -->
        <div class="public" :class="boxClass">three</div>
        <div class="public" :class="{aqua:isAqua,bold:isBold,italic:isItalic}">Four</div>
        <!-- 数组 -->
        <div class="public" :class="classArr">Five</div>
    </div>
    <script>
        const vm = new Vue({
            el: '#app',
            data() {
                return {
                    isActive: 'true',
                    fontColorClass: 'aqua',
                    boxClass: {
                        aqua: true,
                        bold: true,
                        italic: true
                    },
                    isAqua: true,
                    isBold: true,
                    isItalic: true,
                    classArr: ['aqua', 'italic', 'bold']
                }
            }
        })
    </script>
</body>

</html>